//
//  YDTabBarController.swift
//  YDReadFish
//
//  Created by rowena on 2019/3/31.
//  Copyright © 2019年 wuyezhiguhun. All rights reserved.
//

import UIKit

class YDTabBarController: UITabBarController {

    override func viewDidLoad() {
        super.viewDidLoad()
        self.view.backgroundColor = UIColor.white
        addViewController(controller: YDBookcaseController(), imageName: "tabbar_left", title: "书架")
        addViewController(controller: YDAcademiesController(), imageName: "tabbar_center", title: "书院")
        addViewController(controller: YDMeController(), imageName: "tabbar_right", title: "我的")
        
        // Do any additional setup after loading the view.
    }
    
    func addViewController(controller: UIViewController, imageName: String, title: String) {
        controller.title = title
        controller.tabBarItem.image = UIImage(named: imageName)
        controller.tabBarItem.selectedImage = UIImage(named: imageName)
        let navigation = YDNavigationController.init(rootViewController: controller)
        addChild(navigation)
    }

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destination.
        // Pass the selected object to the new view controller.
    }
    */

}
